package com.jasmine.bjstkserver.manager.os;

import cn.hutool.core.util.StrUtil;

/**
 * @author jasmineXz
 */
public abstract class AbstractOsManager implements OsManager {

    protected String matchContentType (String fileName) {
//        if (StrUtil.containsAny(fileName,".jpg",".png",".gif",".ico",".jpeg",".webp")) {
//            return  BjsConstants.CONTENT_TYPE_IMAGE_JPG;
//        } else if (StrUtil.containsAny(fileName,".word",".doc",".docx")) {
//            return "application/msword";
//        }

        if (StrUtil.containsAny(fileName,".xls",".xlsx")) {
            return "application/vnd.ms-excel";
        } else if (StrUtil.containsAny(fileName,".xls",".xlsx")) {
            return  "application/pdf";
        } else if (StrUtil.containsAny(fileName,".mp3")) {
            return "audio/mp3";
        } else if (StrUtil.containsAny(fileName,".mp4")) {
            return "video/mpeg4";
        } else {
            return "application/octet-stream";
        }
    }

}
